Previously, we explored how virtual machines
can autoscale to respond to changing loads. But how do your customers get to your application
when it might be provided by four VMs one moment, and by 40 VMs at another? That’s done through Cloud Load Balancing. The job of a load balancer is to distribute
user traffic across multiple instances of an application. By spreading the load, load balancing reduces
the risk that applications experience performance issues. Cloud Load Balancing is a fully distributed,
software-defined, managed service for all your traffic. And because the load balancers don’t run
in VMs that you have to manage, you don’t have to worry about scaling or managing them. You can put Cloud Load Balancing in front
of all of your traffic: HTTP or HTTPS, other TCP and SSL traffic, and UDP traffic too. Cloud Load Balancing provides cross-region
load balancing, including automatic multi-region failover, which gently moves traffic in fractions
if backends become unhealthy. Cloud Load Balancing reacts quickly to changes
in users, traffic, network, backend health, and other related conditions. And what if you anticipate a huge spike in
demand? Say, your online game is already a hit; do
you need to file a support ticket to warn Google of the incoming load? No. No so-called “pre-warming” is required. VPC offers a suite of load-balancing options. If you need cross-regional load balancing
for a web application, use Global HTTP(S) load balancing. For Secure Sockets Layer traffic that is not
HTTP, use the Global SSL Proxy load balancer. If it’s other TCP traffic that doesn’t
use SSL, use the Global TCP Proxy load balancer. Those last two proxy services only work for
specific port numbers, and they only work for TCP. If you want to load balance UDP traffic, or
traffic on any port number, you can still load balance across a Google Cloud region
with the Regional External Passthrough Network load balancer. On top of that, you can also deploy Regional
External Application load balancer and Proxy Network load balancer. What all those services have in common is
that they’re intended for traffic coming into the Google network from the internet. But what if you want to load balance traffic
inside your project, say, between the presentation layer and the business layer of your application? For that, use the Regional Internal load balancer
that supports Proxy Network load balancer, Passthrough Network load balancer, and Application
load balancer. It accepts traffic on a Google Cloud internal
IP address and load balances it across Compute Engine VMs. Finally, the Google Cloud Cross-region Internal
load balancer is a Layer 7 load balancer that enables you to load balance traffic to backend
services that are globally distributed, including traffic management that ensures traffic is
directed to the closest backend.